Rozdil velikosti fontu na tiskarne
Otázka od: Petr Daricek
28. 4. 2004 16:09
Ahoj,
pokud vytisknu nejaky text na monitor a stejny text take na tiskarnu, tak
nejsou uplne stejne velke. Coz lze zjistit na priklade dole. Nevite nekdo co to
zpusobuje? Tisknu text do ctverce na obrazovce a nasledne na tiskarnu, pokud se
mi na obrazovce vleze text do daneho prostoru a na tiskarne ne, pak je problem.
Diky Petr Daricek
function TForm1.ToMMX(Value: Integer; Canvas: TCanvas): Integer;
begin
Result:=Round(Value*GetDeviceCaps(Canvas.Handle,LOGPIXELSX)/254);
end;
function TForm1.ToMMY(Value: Integer; Canvas: TCanvas): Integer;
begin
Result:=Round(Value*GetDeviceCaps(Canvas.Handle,LOGPIXELSY)/254);
end;
procedure TForm1.Button1Click(Sender: TObject);
const Text='Nejaky text raz dva tri';
begin
Image1.Canvas.Rectangle(ToMMX(10,Image1.Canvas),ToMMY(10,Image1.Canvas),ToMMX(200,Image1.Canvas),ToMMY(50,Image1.Canvas));
Image1.Canvas.TextOut(ToMMX(20,Image1.Canvas),TOMMY(20,Image1.Canvas),Text);
Printer.BeginDoc;
Printer.Canvas.Rectangle(ToMMX(10,Printer.Canvas),ToMMY(10,Printer.Canvas),ToMMX(200,Printer.Canvas),ToMMY(50,Printer.Canvas));
Printer.Canvas.TextOut(ToMMX(20,Printer.Canvas),TOMMY(20,Printer.Canvas),Text);
Printer.EndDoc;
end;